package samples.spring.step3;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import samples.spring.service.HelloWorldService;
import samples.spring.service.impl.HelloWorldServiceImpl;

/**
 * 测试Spring的{@link org.springframework.context.annotation.Configuration }
 * 和 {@link org.springframework.context.annotation.Bean} 是如何注册到容器中的.
 *
 * @see org.springframework.context.annotation.Configuration
 * @see org.springframework.context.annotation.Bean
 */
public class SpringAppStep3 {
    public static void main(String[] args) {
    }
}


@Configuration
class BeanConfig {

    @Bean
    public HelloWorldService helloWorldService() {
        return new HelloWorldServiceImpl();
    }
}